const body = JSON.parse($response.body)
const data = body['data']
const next_activity = data['next']
const current = data['currentFlashSale']
current['activityId'] = next_activity['activityId']
current['activityIdStr'] = next_activity['activityIdStr']
current['startTime'] = next_activity['startTime'] - 3600 * 24 * 7
current['endTime'] = next_activity['startTime'] + 3600 * 24 * 7
current['userResidueActivityRight'] = 1
delete current['order']

const aims = current['aims']
const aims_count = aims.length
for (let index = 0; index < aims_count; index++) {
  const item = aims[index]
  item['aimTotalRight'] = 20
  item['residueAimRight'] = 20
  item['userResidueAimRight'] = 1
  item['aimId'] = item['aimId'] + aims_count
}

const config = current['config']
Object.keys(config).forEach(key => {
  config[key]['aimId'] = config[key]['aimId'] + aims_count
})

data['next'] = data['sec'].filter(x => x['activityId'] === current['activityId'] + 1)[0]
console.log(JSON.stringify(body))
$done({body: JSON.stringify(body)})